-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ibc: delete packet commitments instead of writing empty values #4644
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK on the change, and the migration looks correct too.
To test this, we can:
- Halt a full node running the current chain
- Perform the migration (using
--force
) - Start the node again with peering disabled
- Run
pcli query key ibc-data/commitments/ports/transfer/channels/channel-7/sequences/7
- Observe
Not found
One thing that occurred to me is that perhaps we should make a design change to the storage API to prevent writing empty values, since any empty value (in the ibc substore) will cause this problem |
The IBC spec calls for deletion of packet commitments after a successful acknowledgement, in order to avoid double-acknowledgements. Previously, our implementation accomplished this deletion by writing an empty byte slice vec![] to the commitment path. However, this will cause nonexistence proofs by exclusion (the standard NX-proof type used in ics23) of adjacent keys to fail, since ics23 does not support existence proofs of empty values. This PR changes `delete_packet_commitment` to actually delete the commitment, and introduces a migration for testnet 78 that will delete all of the previously overwritten commitments.
11f24b5
to
72d4d98
Compare
We got it, while testing I found a couple issues with prefix caching, I will open issues shortly. This PR works though, so approving and merging on green CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested the migration on current chain state.
The IBC spec calls for deletion of packet commitments after a successful acknowledgement, in order to avoid double-acknowledgements. Previously, our implementation accomplished this deletion by writing an empty byte slice vec![] to the commitment path. However, this will cause nonexistence proofs by exclusion (the standard NX-proof type used in ics23) of adjacent keys to fail, since ics23 does not support existence proofs of empty values. This PR changes `delete_packet_commitment` to actually delete the commitment, and introduces a migration for testnet 78 that will delete all of the previously overwritten commitments.
The IBC spec calls for deletion of packet commitments after a successful acknowledgement, in order to avoid double-acknowledgements.
Previously, our implementation accomplished this deletion by writing an empty byte slice vec![] to the commitment path.
However, this will cause nonexistence proofs by exclusion (the standard NX-proof type used in ics23) of adjacent keys to fail, since ics23 does not support existence proofs of empty values. We observed this when timeouts from osmosis testnet failed to verify the NX proofs from penumbra testnet.
This PR changes
delete_packet_commitment
to actually delete the commitment, and introduces a migration for testnet 78 that will delete all of the previously overwritten commitments.